package com.liws.hellofeiginclient.controller;

import com.alibaba.fastjson.JSONObject;
import com.liws.hellocommon.entity.Person;
import com.liws.hellofeiginclient.feigin.ProductClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: liweisheng
 * @Dcscription:
 * @Date: 2021/11/22 10:42
 */
@RestController
@RequestMapping("/feigin")
public class FiginClientController {

    @Autowired
    private ProductClient productClient;

    @RequestMapping(value = "/client/getFeiginByName",method = RequestMethod.GET)
    public String getFeiginByName(@RequestParam("name") String name){

        return productClient.getFeiginByName(name);
    }


    @RequestMapping(value = "/client/postFeiginByObject",method = RequestMethod.POST)
    public List<Person> postFeiginByObject(@RequestBody Person person){

        return productClient.postFeiginByObject(person);
    }
}
